$('.checkbox input').iCheck({
    checkboxClass: 'icheckbox_minimal-blue',
    radioClass: 'iradio_minimal-blue',
    increaseArea: '20%' // optional
});

function validity() {
    var username = document.getElementById('username');
    var pass = document.getElementById('password');
    var errtitle = document.getElementById('errtitle');

    if (username.value == null || username.value == "") {
        errtitle.textContent = "请输入用户名";
        username.focus();
        return false;
    }

    if (pass.value == null || pass.value == "") {
        errtitle.textContent = "请输入密码";
        pass.focus();
        return false;
    }
    return true;
}

function trim(str) { //删除左右两端的空格
    return str.replace(/(^\s*)|(\s*$)/g, "");
}